<template>
	<view>
		<uni-list  :border="true">
				<!-- 显示圆形头像 -->
				<view class="" @click.capture="tiao(item.id)"  v-for="(item,index) in carnew.slice(0,num)" :key="index">
					<uni-list-chat   :avatar-circle="true"   :title="item.parkName" :avatar="'http://124.93.196.45:10001'+ item.imgUrl" :note="item.address+'    '+item.distance+'公里'" :time="item.rates+'个车位'" ></uni-list-chat>
				</view>
				<button @click="more">加载更多</button>
		</uni-list>
	</view>
</template>

<script>
	import {request} from '@/utils/request.js'
	export default {
		data() {
			return {
				carnew:[],
				num:5
			}
		},
		onLoad() {
			this.getcarnew()
		},
		methods: {
			more(){
				this.num+=5
			},
			// 获取停车场信息
			async getcarnew(){
				const res=await request({url:"prod-api/api/park/lot/list"})
				console.log(res)
				this.carnew=res.data.rows
				
			},
			tiao(e){
				uni.navigateTo({
					url:"/pages/infocar/infocar?id="+e
				})
			}
			
		}
	}
</script>

<style>

</style>
